

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>用户列表</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/layuiadmin/style/admin.css" media="all">
</head>
<body>

  <div class="layui-fluid">
    <div class="layui-card">

      <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
          <li class="layui-this" lay-id="1">注册读者</li>
          <li lay-id="2">运营读者</li>
        </ul>

        <div class="layui-tab-content">

          <div class="layui-tab-item layui-show">
            <blockquote class="layui-elem-quote">
              在此账号下注册的用户
            </blockquote>
            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
              <div class="layui-form-item">

                <div class="layui-inline">
                  <label class="layui-form-label">关键词</label>
                  <div class="layui-input-block">
                    <input type="text" name="keyword" placeholder="用户ID / 绑定手机" autocomplete="off" class="layui-input">
                  </div>
                </div>


                <div class="layui-inline">
                  <label class="layui-form-label">App</label>
                  <div class="layui-input-block">
                    <select name="quick_id" lay-search>
                      <option value="">请选择</option>
                      {foreach $qas as $k => $v}
                      <option value="{$v.id}">{$v.name}</option>
                      {/foreach}
                    </select>
                  </div>
                </div>


                {if $role->alias != 'channel' && $role->alias != 'agent'}
                <div class="layui-inline">
                  <label class="layui-form-label">注册代理</label>
                  <div class="layui-input-block">
                    <select name="source_agent_id" lay-search>
                      <option value="">请选择</option>
                      {foreach $agents as $k => $v}
                      <option value="{$v.id}">{$v.account}</option>
                      {/foreach}
                    </select>
                  </div>
                </div>
                {/if}

                {if $role->alias != 'channel'}
                <div class="layui-inline">
                  <label class="layui-form-label">注册投放号</label>
                  <div class="layui-input-block">
                    <select name="source_channel_id" lay-search>
                      <option value="">请选择</option>
                      {foreach $channels as $k => $v}
                      <option value="{$v.id}">{$v.account}</option>
                      {/foreach}
                    </select>
                  </div>
                </div>
                {/if}


                <div class="layui-inline">
                  <label class="layui-form-label">是否加桌</label>
                  <div class="layui-input-block">
                    <select name="add_shortcut">
                      <option value="">请选择</option>
                      <option value="1">已加桌</option>
                      <option value="0">未加桌</option>
                    </select>
                  </div>
                </div>


                <div class="layui-inline">
                  <label class="layui-form-label">是否付费</label>
                  <div class="layui-input-block">
                    <select name="is_pay">
                      <option value="">请选择</option>
                      <option value="1">已付费</option>
                      <option value="2">未付费</option>
                    </select>
                  </div>
                </div>


                <div class="layui-inline">
                  <label class="layui-form-label">读者身份</label>
                  <div class="layui-input-block">
                    <select name="is_vip">
                      <option value="">请选择</option>
                      <option value="1">vip会员</option>
                      <option value="2">普通会员</option>
                    </select>
                  </div>
                </div>

                <div class="layui-inline">
                  <label class="layui-form-label">手机绑定</label>
                  <div class="layui-input-block">
                    <select name="have_phone">
                      <option value="">请选择</option>
                      <option value="1">已绑定</option>
                      <option value="2">未绑定</option>
                    </select>
                  </div>
                </div>


                <div class="layui-inline">
                  <label class="layui-form-label">运营读者</label>
                  <div class="layui-input-block">
                    <select name="is_belong">
                      <option value="">请选择</option>
                      <option value="1">是</option>
                      <option value="2">否</option>
                    </select>
                  </div>
                </div>

                <div class="layui-inline">
                  <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-user-back-search2">
                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                  </button>
                </div>

              </div>
            </div>

            <div class="layui-card-body">
              <table id="LAY-user-back-role2" lay-filter="LAY-user-back-role2"></table>
              <script type="text/html" id="table-useradmin-admin2">
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-href="/user/info.html?id={{d.id}}" lay-text="{{d.id}} - 读者"><i class="layui-icon layui-icon-edit"></i>详情</a>
              </script>
            </div>

          </div>

          <div class="layui-tab-item">
            <blockquote class="layui-elem-quote">
              当读者访问过此账号下的推广链接，将会变成此账号下的运营读者（不管是否为本账号下注册）！该读者后续充值和运营权（推荐位、推送消息、充值挡位等等）归属给此账号。<br>
              如果读者访问其他账号下的推广链接，此读者后续充值和运营权将会变更给新账户，并从下方列表消失！（读者充值成功会生成保护期，<span style="color:#FF5722;">保护期内不会变更账号</span>，可询问管理员不同App保护期天数）
            </blockquote>
            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
              <div class="layui-form-item">

                <div class="layui-inline">
                  <label class="layui-form-label">关键词</label>
                  <div class="layui-input-block">
                    <input type="text" name="keyword" placeholder="用户ID / 绑定手机" autocomplete="off" class="layui-input">
                  </div>
                </div>


                <div class="layui-inline">
                  <label class="layui-form-label">App</label>
                  <div class="layui-input-block">
                    <select name="quick_id" lay-search>
                      <option value="">请选择</option>
                      {foreach $qas as $k => $v}
                      <option value="{$v.id}">{$v.name}</option>
                      {/foreach}
                    </select>
                  </div>
                </div>


                {if $role->alias != 'channel' && $role->alias != 'agent'}
                <div class="layui-inline">
                  <label class="layui-form-label">归属代理</label>
                  <div class="layui-input-block">
                    <select name="agent_id" lay-search>
                      <option value="">请选择</option>
                      {foreach $agents as $k => $v}
                      <option value="{$v.id}">{$v.account}</option>
                      {/foreach}
                    </select>
                  </div>
                </div>
                {/if}

                {if $role->alias != 'channel'}
                <div class="layui-inline">
                  <label class="layui-form-label">归属投放号</label>
                  <div class="layui-input-block">
                    <select name="channel_id" lay-search>
                      <option value="">请选择</option>
                      {foreach $channels as $k => $v}
                      <option value="{$v.id}">{$v.account}</option>
                      {/foreach}
                    </select>
                  </div>
                </div>
                {/if}


                <div class="layui-inline">
                  <label class="layui-form-label">是否加桌</label>
                  <div class="layui-input-block">
                    <select name="add_shortcut">
                      <option value="">请选择</option>
                      <option value="1">已加桌</option>
                      <option value="0">未加桌</option>
                    </select>
                  </div>
                </div>


                <div class="layui-inline">
                  <label class="layui-form-label">是否付费</label>
                  <div class="layui-input-block">
                    <select name="is_pay">
                      <option value="">请选择</option>
                      <option value="1">已付费</option>
                      <option value="2">未付费</option>
                    </select>
                  </div>
                </div>


                <div class="layui-inline">
                  <label class="layui-form-label">读者身份</label>
                  <div class="layui-input-block">
                    <select name="is_vip">
                      <option value="">请选择</option>
                      <option value="1">vip会员</option>
                      <option value="2">普通会员</option>
                    </select>
                  </div>
                </div>

                <div class="layui-inline">
                  <label class="layui-form-label">手机绑定</label>
                  <div class="layui-input-block">
                    <select name="have_phone">
                      <option value="">请选择</option>
                      <option value="1">已绑定</option>
                      <option value="2">未绑定</option>
                    </select>
                  </div>
                </div>


                <div class="layui-inline">
                  <label class="layui-form-label">注册读者</label>
                  <div class="layui-input-block">
                    <select name="is_register">
                      <option value="">请选择</option>
                      <option value="1">是</option>
                      <option value="2">否</option>
                    </select>
                  </div>
                </div>

                <div class="layui-inline">
                  <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-user-back-search">
                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                  </button>
                </div>

              </div>
            </div>
            <div class="layui-card-body">
              <table id="LAY-user-back-role" lay-filter="LAY-user-back-role"></table>
              <script type="text/html" id="vipTpl">
                {{#  if(d.vip_text == 'vip会员'){ }}
                <span class="layui-badge">vip会员</span>
                {{#  } else { }}
                <span class="layui-badge layui-bg-blue">普通会员</span>
                {{#  } }}
              </script>

              <script type="text/html" id="channelTpl">
                {{#  if(d.vip_text == 'vip会员'){ }}
                <span class="layui-badge">vip会员</span>
                {{#  } else { }}
                <span class="layui-badge layui-bg-blue">普通会员</span>
                {{#  } }}
              </script>

              <script type="text/html" id="lastTpl">
                {{#  if(d.last_novel){ }}
                {{d.last_novel.title}}
                {{#  } else { }}

                {{#  } }}
              </script>

              <script type="text/html" id="table-useradmin-admin">
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-href="/user/info.html?id={{d.id}}" lay-text="{{d.id}} - 读者"><i class="layui-icon layui-icon-edit"></i>详情</a>
              </script>
            </div>
          </div>

        </div>

      </div>
    </div>
  </div>

 <script src="/static/layuiadmin/layui/layui.js"></script>
  <script>
    layui.use('element', function(){
      var element = layui.element;

      //获取hash来切换选项卡，假设当前地址的hash为lay-id对应的值
      var layid = location.hash.replace(/^#docDemoTabBrief=/, '');
      element.tabChange('docDemoTabBrief', layid); //假设当前地址为：http://a.com#test1=222，那么选项卡会自动切换到“发送消息”这一项

      //监听Tab切换，以改变地址hash值
      element.on('tab(docDemoTabBrief)', function(){
        location.hash = 'docDemoTabBrief='+ this.getAttribute('lay-id');
      });
    });
  </script>

  {if $role->alias == 'channel'}
    {include file="user/readers/channelUsers" /}
  {elseif $role->alias == 'agent' /}
    {include file="user/readers/agentUsers" /}
  {elseif $role->alias == 'eb' /}
    {include file="user/readers/ebUsers" /}
  {/if}
</body>
</html>

